package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.Menu;
import com.itheima.pojo.Role;

import java.util.List;
import java.util.Map;

/**
 * @author Lz
 * @date 2020-03-06 20:59
 * @week 星期五
 */
public interface MenuDao {
    //分页查询菜单
    public Page<Menu> findPage(String queryString);

    //查询所有父菜单选项
    public List<Map<String, Object>> findAllParentMenu();
    //添加菜单
    public void add(Menu menu);

    //查询该路径是否已存在
    public String pathIsExist(String path);

    //查询该菜单优先级是否已经存在
    public Menu priorityIsExist(Menu menu);

    String getPathByParentMenuId(Integer parentMenuId);

    public Menu findById(Integer id);

    public void edit(Menu menu);

    //根据父菜单id查找子菜单
    public List<Menu> findMenuByParentMenuId(Integer id);

    void updateChildrenMenuPath(Menu childrenMenu);

    //根据菜单id查询是否有关联的角色
    public List<String> findCountByMenuId(Integer id);

    public void deleteById(Integer id);

    public List<Menu> getMenus(String username);

    //查询子菜单
    public List<Menu> findChildren(Integer id);

}
